home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 182 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.5 KB

  1. Path: tko.dec.com!diamond
  2. From: diamond@tko.dec.com (Norman Diamond)
  3. Newsgroups: comp.lang.c,comp.std.c
  4. Subject: Re: Integral conversion e.t.c.
  5. Followup-To: comp.std.c
  6. Date: 25 Jan 1996 05:54:52 GMT
  7. Organization: Digital Equipment Corporation Japan , Tokyo
  8. Message-ID: <4e75vc$o1i@usenet.pa.dec.com>
  9. References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM> <4e1nd8$hv0@solutions.solon.com> <3104bfc8.132251392@nntp.ix.netcom.com> <4e2ppd$lsu@solutions.solon.com> <DLnG5H.748@mv.mv.com> <DLoy4x.AFG@mv.mv.com>
  10. Reply-To: diamond@jrdv04.enet.dec-j.co.jp (Norman Diamond)
  11. NNTP-Posting-Host: jit533.tko.dec.com
  12.  
  13. In article <DLoy4x.AFG@mv.mv.com>, ENGR@GSSI.MV.COM (Michael Furman) writes:
  14. >  Could somebody please clarify is "C" standard so strict and does not let
  15. >use some constructions that "C++" draft stadard let? Namely:
  16. >1. Integer conversion when source value can not be represented in destination
  17. >type. In C++ it is defined. In case of both unsigned types it completely
  18. >defined in standard; othervise details of "how it will be converted" must
  19. >be defined by implementation. 
  20.  
  21. This is the same in C, except in some cases involving floating-point.
  22. If a floating-point number is demoted or converted to an integral type
  23. but the value doesn't fit in the new type then behavior is undefined.
  24.  
  25. >2. Implementation extention: additional forms of function main, like:
  26. >int main(int argc, char * * argv, char * env);
  27. >In C++ draft standard said that any implementation must allow 2 kinds if
  28. >"main" definitions, but does not forbid extentions.
  29.  
  30. The C standard is the same.  Any program that obeys the standard will
  31. have one of the 2 prescribed kinds of "main" definitions, and every
  32. implementation must allow those 2 kinds.  This is not in a Syntax or
  33. Constraints section, so violations do not require diagnostics.
  34. Implementations are free to offer extensions silently, offer extensions
  35. noisily, reject programs that depend on such extensions, erase your
  36. hard disk, or whatever they like.
  37.  
  38. If you have some reason to write implementation-dependent code and
  39. depend on extensions promised by your vendor, the standard does not
  40. stop you.  50% of programs do this.  (The other 50% depend on extensions
  41. that are not promised by their vendors :-)
  42. --
  43.  <<  If this were the company's opinion, I would not be allowed to post it.  >>
  44. "I paid money for this car, I pay taxes for vehicle registration and a driver's
  45. license, so I can drive in any lane I want, and no innocent victim gets to call
  46. the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
  47.